#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[35] = { 0 }, arr1[35] = { 0 };
	char m, n;
	scanf("%s %c %c", &arr[0], &m, &n);
	//gets(arr);
	int a = strlen(arr);
	//scanf("%c %c", &m, &n);
	int i = 0;
	for (i = 0; i < a; i++)
	{
		if (arr[i] == m)
			arr1[i] = n;
		else
			arr1[i] = arr[i];
	}
	for (i = 0; i < a; i++)
	{
		printf("%c", arr1[i]);
	}
	return 0;
}
